package com.lantosec.hmrp.modules.notify.entity;

import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.notify.vo.NotifyPublicReadVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 公告读看信息 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NotifyPublicRead extends BaseEntity<NotifyPublicReadVO> {

    private static final long serialVersionUID = 1L;
    public NotifyPublicRead(NotifyPublicReadVO vo){
        this.notifyId = vo.getNotifyId();
        this.userId = vo.getUserId();
        this.readMode = vo.getReadMode();
        this.readTime = vo.getReadTime();
    }

    @Override
    public NotifyPublicReadVO convertToVO(){
        return new NotifyPublicReadVO(this);
    }


    /**
     * 通知ID
     */
    @TableId(value = "notify_id", type = IdType.ASSIGN_UUID)
    private String notifyId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 接收方式(1web 2手机)
     */
    private Integer readMode;

    /**
     * 已读时间
     */
    private Date readTime;


    public enum ColName {
        notify_id, user_id, read_mode, read_time, 
    }
}
